﻿using System;
using MongoDB.Bson;

namespace CQRS.Events
{
    public class MongoObject
    {
        public MongoObject()
        {
            Id = ObjectId.GenerateNewId();
        }

        public ObjectId Id { get; private set; }
    }

    [Serializable]
    public class Event : MongoObject
    {
        public Event()
        {
            AggregateId = ObjectId.GenerateNewId();
        }

        public ObjectId AggregateId { get; set; }
        public int Version { get; set; }
    }
}